from tkinter import *
 
root = Tk()
text1 = Text(root,width=30,height=10)
text1.pack()
 
# text1.insert(INSERT,'lan\r\nlu\r\nyug')
contents = text1.get('1.0',END)
print(contents)
print(len(contents))
mainloop()